package com.zfl.remove;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class UserNode {
    private String userId;
    private Long loginTime;

    public UserNode(String userId) {
        this.userId = userId;
        this.loginTime = System.currentTimeMillis();
    }

    public boolean isTimeOut(long timeOutMillis) {
        return System.currentTimeMillis()-this.loginTime>timeOutMillis;
    }
}
